#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,sbtsk1,val[N],vis[N];
void SC(){
    int cnt=0;
    for(int i=1;i<=n;i++) cnt+=(val[i]==2);
    cout<<cnt;
    return;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>val[i];
        if(val[i]>2) sbtsk1=1;
    }
    if(!sbtsk1) SC();
    else{
        int cnt=0,lst=1;
        sort(val+1,val+1+n);
        for(int i=2;i<=n;i++){
            for(int j=lst;j<i;j++){
                if(!vis[j]&&val[i]>val[j]){
                    vis[j]=1;
                    lst=j+1;
                    cnt++;
                    break;
                }
            }
        }
        cout<<n-cnt;
    }
    return 0;
}
